import request from '@/utils/request'

// 获取员工列表
export function getEmployeesListAPI(params) {
  return request({
    url: '/sys/user',
    params
  })
}
// 删除-员工
export function deleteAtaffMessageAPI(id) {
  return request({
    url: `sys/user/${id}`,
    method: 'delete'
  })
}
// 增加-员工
export function addEmployeesAPI(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 批量获取员工
export function importEmployees(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 获取所有角色列表
export function getAllRoleListAPI(params) {
  return request({
    url: '/sys/role',
    method: 'get',
    params
  })
}

/**
 * @description 获取用户的基本信息
 * @param {string} id
 * @returns
 **/
export function getUserDetailById(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
}
// 给员工分配角色
export function giveEmpAssignRoleAPI(empId, roleIdsArr) {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data: {
      id: empId,
      roleIds: roleIdsArr
    }
  })
}
